package com.ytkj.digitalConstruction.controller.base;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ytkj.digitalConstruction.ReturnCode;
import com.ytkj.digitalConstruction.entity.base.Config;
import com.ytkj.digitalConstruction.service.base.BaseService;

/**
 * 基础数据入口
 * @author 张重阳
 *
 */
@RestController
@RequestMapping("/base")
public class BaseController {
	
	@Autowired
	private BaseService baseService;
	
	@GetMapping("/messageType")
	public ReturnCode messageType() {
		List<Config> messageTypes = baseService.messageType();
		if(messageTypes != null) {
			return new ReturnCode.Builder().Object(messageTypes).Msg("消息类型获取成功！").build();
		}
		return new ReturnCode.Builder().Success(false).Msg("消息类型获取失败！").build();
	}
}
